home *** CD-ROM | disk | FTP | other *** search
-
-
-
- NCD(1) NCD(1)
-
-
- NNAAMMEE
- ncd - Ninux Change Directory: browse & select directories
-
-
- SSYYNNOOPPSSIISS
- nnccdd [ --ooppttiioonnss ] [ ddiirreeccttoorryy ]
-
-
- DDEESSCCRRIIPPTTIIOONN
- nnccdd is an interactive fullscreen directory browser that
- lets you select and change to the desired directory. It
- also lets you change quickly in non-interactive mode to a
- directory selected in the command line. nnccdd supports
- incomplete directory specification in the command line,
- and is able to perform automatic search in browser mode.
-
- If you provide a directory name in the command line, nnccdd
- will run in non-interactive mode, and will try to change
- to the next directory that matches completely or partially
- the specified one.
-
- If you don't provide a directory name in the command line,
- nnccdd will run in interactive mode. You can browse up and
- down the directory tree, search for a directory, and
- accept or cancel the selection of a directory to change
- to.
-
- To get a faster response, nnccdd keeps a directory tree
- database in the user's home directory (obtained from $$HHOOMMEE
- environment variable). The database actually consists on a
- couple of files: ..nnccdd__hhttrreeee, that keeps the directory tree
- starting from the user home directory, and ..nnccdd__ffttrreeee that
- keeps the full system directory tree, starting from the
- root directory //. All the home tree stored somewhere in
- the full tree file ..nnccdd__ffttrreeee is discarded, and it is
- recreated based on the home tree read from ..nnccdd__hhttrreeee. In
- this way, the user can add/delete directories below his
- home directory and rebuild just the home ..nnccdd__hhttrreeee.
- database, avoiding to rebuild the long ..nnccdd__ffrreeee full sys-
- tem tree.
-
- The program can run in two scope modes: hhoommee--ssccooppee mode or
- ffuullll--ssccooppee mode. In hhoommee--ssccooppee mode, only the home direc-
- tory tree is available, and the program has no view of any
- directory external to this local tree. In ffuullll--ssccooppee mode,
- the full system tree starting from // is available for view
- and search operations. Normally the mode is automatically
- selected based on the current work directory at invocation
- time: hhoommee--ssccooppee mode is selected if the current directory
- is located under the home directory. Otherwise, ffuullll--ssccooppee
- is selected. This behaviour can be overriden using command
- line options. If you specify a directory in the command
- line (non-interactive mode) you can easily force ffuullll--
- ssccooppee mode starting the directory name with a slash //.
-
-
-
- ncd 20 May 1995 1
-
-
-
-
-
- NCD(1) NCD(1)
-
-
- This does not mean that the directory must hang from the
- root directory; to do this, add two slashes, except for
- root directory selection, that just needs one slash.
-
- If the current work directory at invocation time is not
- registered in the program database files, the database
- (home or full depending on scope mode) is automatically
- rebuilt. This can be overriden using command line options.
-
-
- CCOOMMMMAANNDD LLIINNEE OOPPTTIIOONNSS
- You can supply command line options to customize some ncd
- actions. Options can be grouped behind a single --. You
- can also specify default options in the NNCCDD__OOPPTTSS environ-
- ment variable, using the same sintax as in the command
- line. Command line options override NNCCDD__OOPPTTSS options.
-
- This is a list of the supported command line options:
-
- --ff select full-scope mode (starting from //). On
- rebuild, both ..nnccdd__ffttrreeee and ..nnccdd__hhttrreeee are
- rebuilt.
-
- --hh select home-scope mode (starting from $$HHOOMMEE). On
- rebuild, only ..nnccdd__hhttrreeee is rebuilt.
-
- --HH select automatic-scope mode. This will choose full-
- scope or home-scope depending on the current work-
- ing directory at invocation time. This is the
- ddeeffaauulltt scope mode.
-
- --rr force rebuilding the database (home or full,
- depending on the scope mode).
-
- --RR disable the database forced rebuild. This cancels
- any previous --rr, but does not cancel an automatic
- rebuild (use --AA to cancel that one).
-
- --aa select automatic rebuild mode. if the current
- working directory at invocation time is not in the
- program database, a rebuild is performed (home or
- full, depending on the scope mode). This is the
- ddeeffaauulltt auto-rebuild mode.
-
- --AA disable automatic rebuild mode.
-
- --vv Verbose on. Usefull for debug purposes or if you
- get bored while rebuilding the full tree.
-
- --VV Verbose off. This is the ddeeffaauulltt verbose mode.
-
- --dd dumps directory tree. This will make a nice listing
- of the directory tree to stdout (home or full,
- depending on the scope). Just usefull to export the
-
-
-
- ncd 20 May 1995 2
-
-
-
-
-
- NCD(1) NCD(1)
-
-
- directory tree to a text file. The program will
- exit inmediately after the listing, returning an
- error code (not 0), it will not perform any change
- directory operation.
-
- --DD Cancels any previous --dd.
-
- --tt Force text-chars display of the directory tree. If
- not forced, curses line-art characters are used.
- Curses chars are nice on terminals that suport
- line-art characters (as the linux console), but you
- get an ugly view on other terminal types. If you
- use --tt, you get a bit better display.
-
- --TT cancels any previous --tt and also cancels automatic
- line-art/text-char select ( --xx ). So this forces
- curses chars display.
-
- --xx selects automatically line-art/text-chars display
- of the directory tree. This is the ddeeffaauulltt.
-
- --ll View expanded links ( llddiirr -->> ddiirr// )
-
- --LL View compacted links ( llddiirr@@ ). This is the
- ddeeffaauulltt.
-
- --?? --ii Shows a summary of command line options.
-
-
- BBRROOWWSSEERR KKEEYYSS
- When invoqued in interactive mode, these are the character
- sequences and keys to use the browser.
-
-
- KKeeyyDDoowwnn oorr CCttrrll++NN::
- Move down (next brother).
-
- KKeeyyUUpp oorr CCttrrll++PP::
- Move up (previous brother).
-
- KKeeyyLLeefftt oorr CCttrrll++BB::
- Move left (father).
-
- KKeeyyRRiigghhtt oorr CCttrrll++FF::
- Move right (son).
-
- KKeeyyHHoommee oorr CCttrrll++AA::
- Move to first directory in tree ( $$HHOOMMEE or // ).
-
- KKeeyyEEnndd oorr CCttrrll++EE::
- Move to last descendant of current node.
-
- KKeeyyPPggUUpp oorr CCttrrll++UU::
- Move one page up.
-
-
-
- ncd 20 May 1995 3
-
-
-
-
-
- NCD(1) NCD(1)
-
-
- KKeeyyPPggDDnn oorr CCttrrll++VV::
- Move one page down.
-
- KKeeyyFF77 oorr CCttrrll++OO::
- Last directory of previous line.
-
- KKeeyyFF88 oorr CCttrrll++JJ::
- First directory of next line.
-
- CCttrrll++TT::
- Opposite movement of KKeeyyRRiigghhtt. This is not
- KKeeyyLLeefftt. KKeeyylleefftt moves back to the father direc-
- tory.
-
- KKeeyyTTeexxtt ((aannyy tteexxtt kkeeyy oorr ddiissppllaayyaabbllee cchhaarraacctteerr))::
- Adds the character to the search string. As you add
- chars, the program will try to match the resulting
- string to a directory in the tree. If no match is
- possible, the character is rejected. The match is
- partial, so it is not necessary to type a whole
- directory name to match it. If you want to force a
- total match, add a final slash // to the search
- string. After you add a slash you can go on adding
- chars, so actually the search is not limited to a
- simple directory name, but can also search for
- paths.
-
- KKeeyyFF99 oorr CCttrrll++KK::
- Move to next directory that matches the current
- search field.
-
- BBaacckkssppaaccee oorr CCttrrll++HH::
- Delete last character from the search field.
-
- DDeell oorr CCttrrll++DD::
- Clears completely the search field.
-
- KKeeyyFF55 oorr CCttrrll++LL::
- If the current selection is a link, follow it to
- the destination directory.
-
- KKeeyyFF66 oorr CCttrrll++GG::
- Toggles between viewing expanded links ( llddiirr -->>
- ddiirr// ) and compacted links ( llddiirr@@ ). The initial
- mode is command line selected using --ll and --LL. The
- default mode is to show compacted links.
-
- KKeeyyFF44 oorr CCttrrll++WW::
- Repaint the full screen. Use this when some back-
- ground process disturbs your display, or some other
- user tries to wwrriittee(1) or ttaallkk(1) to you.
-
- KKeeyyFF22 oorr CCttrrll++RR::
- Performs a directory tree rescan. The directory
-
-
-
- ncd 20 May 1995 4
-
-
-
-
-
- NCD(1) NCD(1)
-
-
- database is rebuilt (home or full, depending on the
- scope mode).
-
- KKeeyyFF33 oorr CCttrrll++YY::
- Toggle the scope mode, between home and full scope.
-
- RReettuurrnn oorr EEnntteerr oorr CCttrrll++MM::
- Accepts the directory selected, and exits changing
- the current working directory to it.
-
- KKeeyyFF1100 oorr EEsscc oorr CCttrrll++XX oorr MMeettaa++XX::
- Quit. Cancels directory selection.
-
- KKeeyyFF11 oorr CCttrrll++II::
- Displays a little help screen.
-
-
- SSHHEELLLL AALLIIAASS//FFUUNNCCTTIIOONN
- nnccdd is actually an executable binary and a shell alias or
- function that calls it; in this way, we can change the
- working directory of the current shell. The return value
- of the binary executable is 00 if the user has selected a
- valid directory. On error or if the operation has been
- cancelled, the program returns a value ddiiffffeerreenntt ttoo 00.
- The destination directory is returned in the file
- $$HHOOMMEE//nnccdd__ssddiirr allows blind changing to the directory kept
- in $$HHOOMMEE//nnccdd__ssddiirr without testing the return value of the
- program.
-
- Assuming that the binary program is //uussrr//bbiinn//nnccdd, the
- shell alias/function should be the following,
-
- for the bbaasshh sshheellll, define this function:
-
- function ncd()
- {
- /usr/bin/ncd $*;
- if [ $? = 0 ]; then
- cd "$(cat $HOME/.ncd_sdir)";
- fi
- }
-
- for the ttccsshh sshheellll, define this alias (here shown in two
- lines; actually it's just one line):
-
- alias ncd '/usr/bin/ncd * ;
- if $? == 0 cd "`cat $HOME/.ncd_sdir`" '
-
- You can include this alias/function in your login script,
- or in the system wide login script. See bbaasshh(1) or ttccsshh(1)
- manpages for help on this.
-
-
-
-
-
-
- ncd 20 May 1995 5
-
-
-
-
-
- NCD(1) NCD(1)
-
-
- EENNVVIIRROONNMMEENNTT
- NNCCDD__OOPPTTSS
- You can specify default options in this environment
- variable, using the same sintax as in the command
- line. Command line options override NNCCDD__OOPPTTSS val-
- ues.
-
-
- FFIILLEESS
- $$HHOOMMEE//..nnccdd__hhttrreeee home tree database.
-
- $$HHOOMMEE//..nnccdd__ffttrreeee full tree database.
-
- $$HHOOMMEE//..nnccdd__ssddiirr directory selected in last execution.
-
-
- AAUUTTHHOORR
- Borja Etxebarria <borja@bips.bi.ehu.es>
- <jtbecgob@s835cc.bi.ehu.es>
-
-
- BBUUGGSS
- Sure a lot.
-
- Please, report any bug or improvement to the author
- Include a complete, self-contained example that will allow
- the bug to be reproduced, and say which version of ncd you
- are using.
-
-
- CCOOPPYYRRIIGGHHTT
- Copyright (C) 1995, Borja Etxebarria
- Basque Country University
-
- This program is free software; you can redistribute it
- and/or modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be
- useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the GNU General Public License for more
- details.
-
- You should have received a copy of the GNU General Public
- License along with this program; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
- 02139, USA.
-
-
- SSEEEE AALLSSOO
- bbaasshh(1), ttccsshh(1)
-
-
-
-
-
- ncd 20 May 1995 6
-
-
-